package com.eci.common.util;

import java.util.Arrays;
import java.util.Collection;

public class CollectionUtil {
    /**
     * 判断list是否为空
     * @param collection
     * @return
     */
    @SuppressWarnings("rawtypes")
    public static boolean isEmpty(Collection collection){
        if(collection == null || collection.size() == 0){
            return true;
        }else{
            return false;
        }
    }

    /**
     * 判断list是否不为空
     * @param collection
     * @return
     */
    @SuppressWarnings("rawtypes")
    public static boolean isNotEmpty(Collection collection){
        return !isEmpty(collection);
    }

    public static boolean isIn(Object text, Object... col) {
        return Arrays.asList(col).contains(text);
    }
}
